{template 'common/header'}
{template 'common_css'}

<div class="main">
    <div class="panel panel-info">
        <div class="panel-heading">筛选</div>
        <div class="panel-body">
            <form action="./index.php" method="get" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="dayu_sms" />
                <input type="hidden" name="do" value="log" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">使用模块</label>
                    <div class="col-xs-12 col-sm-5 col-lg-4">
						<select name="addons" class="form-control">
							<option value="" {if $_GPC['addons']==''}selected="selected"{/if}>全部模块</option>
							{if pdo_tableexists('dayu_form')}
							<option value="dayu_form" {if $_GPC['addons']=='dayu_form'}selected="selected"{/if}>{$modules['dayu_form']['title']}</option>
							{/if}
							{if pdo_tableexists('dayu_yuyuepay')}
							<option value="dayu_yuyuepay" {if $_GPC['addons']=='dayu_yuyuepay'}selected="selected"{/if}>{$modules['dayu_yuyuepay']['title']}</option>
							{/if}
							{if pdo_tableexists('dayu_istore_store')}
							<option value="dayu_istore" {if $_GPC['addons']=='dayu_istore'}selected="selected"{/if}>{$modules['dayu_istore']['title']}</option>
							{/if}
							{if pdo_tableexists('dayu_order_agent')}
							<option value="dayu_order" {if $_GPC['addons']=='dayu_order'}selected="selected"{/if}>{$modules['dayu_order']['title']}</option>
							{/if}
							{if pdo_tableexists('dayu_card_fields')}
							<option value="dayu_card" {if $_GPC['addons']=='dayu_card'}selected="selected"{/if}>{$modules['dayu_card']['title']}</option>
							{/if}
							{if pdo_tableexists('dayu_jiaolian')}
							<option value="dayu_jiaolian" {if $_GPC['addons']=='dayu_jiaolian'}selected="selected"{/if}>{$modules['dayu_jiaolian']['title']}</option>
							{/if}
						</select>
                    </div> 
				<div class="col-xs-12 col-sm-5 col-lg-5">
					<div class="input-group">
						<span class="input-group-addon">手机号码：</span>
						<input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
					</div>
				</div>              
			</div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">发送状态</label>
                    <div class="col-xs-12 col-sm-5 col-lg-2">
						<select name="status" id="status" class="form-control">
							<option value="" {if $_GPC['status']==''}selected="selected"{/if}>全部</option>
							<option value="1" {if $_GPC['status']=='1'}selected="selected"{/if}>成功</option>
							<option value="0" {if $_GPC['status']=='0'}selected="selected"{/if}>失败</option>
						</select>
                    </div>
                    <div class="col-xs-12 col-sm-5 col-lg-4">
                        <span class="btn btn-default" disabled>时间范围</span>
                        {php echo tpl_form_field_daterange('time',array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)), true)}
                    </div>
                    <div class="col-xs-12 col-sm-5 col-lg-3">
                        <div class="btn-group">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        <a href="{php echo $this->createWebUrl('log')}" class="btn btn-primary">全部</a>
                        </div>
						<button type="button" class="btn btn-default">总记录数：{$total}</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
        <form action="" method="post" onsubmit="return formcheck(this)">
			<div class="panel panel-default">
				<div class="panel-body table-responsive">
					<table class="table table-hover">
						<thead>
							<tr>
								<th style="width:50px;" class="text-center">ID</th>
								<th class="text-center" style="width:60px;">粉丝</th>
								<th>接收号码</th>
								<th style="width:15%;">模板</th>
								<th style="width:8%;" class="text-center">验证码</th>
								<th class="text-center" style="width:15%;">模块</th>
								<th style="width:8%;">发送状态</th>
								<th style="width:150px;">发送时间</th>
								<th style="width:80px;" class="text-right">操作</th>
							</tr>
						</thead>
						<tbody>
			{loop $list $row}
				<tr>
					<td class="text-center">{$row['id']}</td>
					<td class="text-center">
						{if !empty($row['openid'])}<span class="text-info" style="text-align:center;"><a href="{php echo url('mc/member/post', array('uid'=>$row['user']['uid']));}" target="_blank"><img src="{if !empty($row['user']['tag']['avatar'])}{$row['user']['tag']['avatar']}{else}resource/images/noavatar_middle.gif{/if}" width="48" data-toggle="tooltip" data-placement="bottom" class="btn btn-xs" title="{$row['user']['nickname']}"></a></span>{/if}
					</td>
					<td>
						{$row['mobile']}
					</td>
					<td>
						{$row['sms']['title']}
					</td>
					<td class="text-center">
						{$row['num']}
					</td>
					<td class="text-center">
						<span class="label label-success">{$row['module']['title']}</span>
					</td>
					<td>
						<span class="label label-default {if $row['status']==1}label-primary{/if}">{if $row['status']==1}<i class="fa fa-check-square-o"></i> 成功{else}<i class="fa fa-times-circle-o"></i> 失败{/if}</span>
					</td>
					<td>
						<small>{php echo date('Y-m-d H:i:s', $row[createtime]);}</small>
					</td>
					<td class="text-right">
						<a href="{php echo $this->createWebUrl('log', array('op' => 'delete', 'id' => $row['id']))}" class="btn btn-default btn-sm" onclick="return confirm('确认删除此记录吗？');return false;"><i class="fa fa-remove"></i> 删除</a>
					</td>
				</tr>
			{/loop}
			</tbody>
					</table>
				</div>
           </div>
        </form>
{$pager}
</div>
<script language='javascript'>
require(['bootstrap'],function($){
	$('.btn').hover(function(){
		$(this).tooltip('show');
	},function(){
		$(this).tooltip('hide');
	});
	$('.badge').hover(function(){
		$(this).tooltip('show');
	},function(){
		$(this).tooltip('hide');
	});
});
</script>
{template 'common/footer'}